<?php require_once('../includes/conn.php'); ?>
<?php
session_start();
include("../includes/settings.inc.php");

//print_r($_POST);
		


if(isset($_POST['status']) && count($_POST['status'])>0)
{
  foreach($_POST['status'] as $status_data)
  { 
 	
	$s1 = "SELECT user_status FROM user_profiles where id = '".$status_data."'";
	$q1 = mysql_query($s1) or die($s1);
	$r1 = mysql_fetch_array($q1);
	
	 if($r1["user_status"] == "1")
	 {
	 	$status = 0;
	 }
	 else
	 {
	 	$status = 1;
	 }
  	 $s = "update user_profiles set user_status  = '".$status."' where id  = '".$status_data."'";
  	 $q = mysql_query($s) or die($s);
  } 
} 
  echo "<script language='javascript'>
   		alert('Successfully Updated the Records');
   		window.location ='".$_SERVER['HTTP_REFERER']."';
   		 </script>";  
?>